{% extends "base.html" %}
{% block title %}新建用户{% endblock %}
{% block head %}
<style type="text/css">

</style>
{% endblock %}
{% block content %}


<p>用户注册</p>
<hr />
<form action="{{ url_for('admin.add') }}" method="post" class="form-group-control">
    {% with errors = get_flashed_messages(category_filter=["error"]) %}
    {% if errors %}
    {% for msg in errors %}
    <div class="alert alert-danger alert-dismissible fade show" role="alert">
      <strong>{{ msg }}</strong>
      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
        <span aria-hidden="true">&times;</span>
      </button>
    </div>
    {% endfor %}
    {% endif %}
    {% endwith %}
    {%for f in form%}
    {%if f.name == 'csrf_token' or f.name == 'submit' %}
    <div class="form-group row">
        <div class="col-sm-4 offset-2">
            {{f}}
        </div>
    </div>
    {%else%}
    <div class="form-group row">
        {{f.label(class='col-sm-2 col-form-label col-form-label-md')}}
        <div class="col-sm-4">
            {{f}}
        </div>
        {{f.label(class='col-sm-2 col-form-label col-form-label-md')}}
    </div>
    {%endif%}
    {%endfor%}
</form>

{% endblock %}